package org.codeart.order.remote;

import org.codeart.common.dto.PriceRule;
import org.codeart.common.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "service-price")
public interface ServicePriceClient {

    @PostMapping("/price/rule/exists")
    R<Boolean> ifPriceExists(@RequestBody PriceRule priceRule);

    @PostMapping("/price/calculate-price")
    R<Double> calculatePrice(@RequestParam("distance") Integer distance,
                             @RequestParam("duration") Integer duration,
                             @RequestParam("cityCode") String cityCode,
                             @RequestParam("vehicleType") String vehicleType);
}
